//
// Created by liushuai on 2020/5/23.
//
#include "minDepth.h"
int minDepth(TreeNode* root){
    if(!root)
        return 0;
    else{
        int leftDepth = minDepth(root->left);
        int rightDepth = minDepth(root->right);
        return leftDepth<rightDepth?leftDepth+1:rightDepth+1;
    }
}
